<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="box">

</div>

<script>
    const box = document.querySelector('.box');
    let name = '李四',age = 10,id = 1;

    box.innerHTML = `
    <p id=${id}>姓名：${name}</p>
    <p>年龄：${age}</p>
    `;
</script>
</body>
</html>